﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using Microsoft.MediaCenter.UI;
using Microsoft.MediaCenter;
/*
 播放类：实现按MCML点击寻找MTVLIST中的ID位置，得到MTV资源的URL网络地址 
 */
namespace MyMV
{
    public class PM : ModelItem
    {
        public PM()
        { 
        }
        public void Play(int id)
        {


            string url = LibraryManagement.MList[id].ToString().Split('$')[2];                            //得到MTV类中的MLIST结构
            if (Application.Current.MediaCenterEnvironment != null)
            {
                // Play
                Application.Current.MediaCenterEnvironment.PlayMedia(MediaType.Video,url,false);            //播放视频 
                Application.Current.MediaCenterEnvironment.MediaExperience.GoToFullScreen();                //将视频全屏播放
                
          
                
            }
            else
            {
                Debug.WriteLine("Play " + url);
            }
        
        
        }
    }
}
